<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>testorder</title>
    <link rel="stylesheet" href="css/fore/order.css">
    <link rel="stylesheet" href="css/fore/index.css">
    <link rel="stylesheet" href="css/fore/testorder.css">
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
    <script src="js/jquery/jquery.js"></script>
    <script src="js/vue.min.js"></script>
    <script src="js/fetch.min.js"></script>
    <script src="js/axios.min.js"></script>

</head>
<body>
<div class="header">
    <div class="top">
        <div class="top-logo fl">
            <a id="logo" href="index.html"><img src="img/car-logo.png" alt="" class="fl"
                                                                style="margin-top: 20px;width: 45px"><span
                    class="top-logo-text">练车预约系统</span></a>
        </div>
    </div>
    <div class="header-nav">
        <ul id="nav-list">
            <li class="nav-list-li"><a href="index.html">首页</a></li>
            <li class="nav-list-li"><a href="selectcoach.html">明星教练</a></li>
            <li class="nav-list-li"><a href="testorder.html">考试报名</a></li>
            <li class="nav-list-li"><a href="order.html">练车预约</a></li>
            <li class="nav-list-li"><a href="teachingvideo.html">驾考视频</a></li>
            <li class="nav-list-li"><a href="register.html">驾校报名</a></li>
        </ul>
    </div>
</div>

<div  id="allContent" class="headlineC">
    <div id="panel1" class="panel panel-warning">
        <div class="panel-heading">预约成功</div>
        <div class="panel-body">
            <p class="testoderSuccess-p">时间：{{e.date_}}</p>
            <p class="testoderSuccess-p">地点：{{e.place}}</p>
            <p class="testoderSuccess-p">考试类型：{{e.type_}}</p>
            <p class="testoderSuccess-p">考试车型：{{e.carModel}}</p>
            </br>
            <p class="testoderSuccess-p" style="text-align: center">请报名考试的学员抓紧时间练习!</p>
            <div class="cancel" align="center" @click="cancel()">
                <button type="button" class="btn btn-danger">取消报名</button>
            </div>
        </div>
    </div>
</div>
<div class="footer">
    <p>
        Good CarTeacher©2018 | QQ:123456789
        <a href="#">|关于我们</a>
        <a href="login.html">|驾校登录</a>
    </p>
</div>
<script>
    var url = "fore_student_RecentlyExam";
    new Vue({
        el: '#allContent',
        data: {
            e: []
        },
        mounted: function () {
            var self = this;
            fetch(url).then(function (response) {
                response.json().then(function (jsonObject) {
                    self.e = jsonObject.e;
                   console.log(jsonObject);

                }).catch(function (err) {
                    console.log("Fetch错误：" + err);
                })
            });
        },
        methods:{
            cancel: function () {
                var self = this;
                url = "fore_student_cancelExam";
                console.log(url);
                axios.get(url).then(function (response) {
                    var flag = response.data.flag;
                    if(flag == 1)
                        window.location.replace("testorder.html");

                })
            }
        }
    });
</script>
</body>
</html>